package com.jsb.laundry.service.designpatterns.chainofresponsibility.orderservice.impl;

import com.jsb.laundry.model.vo.OrderListVo;
import com.jsb.laundry.service.OrderInfoService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 第一次
 */
public class FirstHandler extends Handler {
    @Resource
    private OrderInfoService orderInfoService;
    /**
     * 当待接单状态
     */
    public FirstHandler() {
        super(1);
        //也可省去此处代码，在应用场景中自由组合
        setNextHandler(new TwiceHandler());
    }

    @Override
    protected List handleHook(Rider rider) {
        //模拟复杂逻辑处理
        List<OrderListVo> byUserInfoList = orderInfoService.findByUserInfoList();

        return byUserInfoList;
    }
}

